package fr.afcepf.atod12.afcepfvoyage.services;

import java.util.Collection;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import fr.afcepf.atod12.afcepfvoyage.beans.Client;
import fr.afcepf.atod12.afcepfvoyage.beans.Offre;
import fr.afcepf.atod12.afcepfvoyage.dao.generic.IGenericDao;
import fr.afcepf.atod12.afcepfvoyage.exceptions.ServiceException;
import fr.afcepf.atod12.afcepfvoyage.services.interfaces.IServiceOffre;

@Service("serviceOffres")
@Transactional(rollbackFor = ServiceException.class)
public class ServiceOffreImpl implements IServiceOffre {

	private IGenericDao<Offre> gnDao;
	
	@Autowired
	public void setUlDao(IGenericDao<Offre> gnDao) {
		this.gnDao = gnDao;
	}
	
	@Override
	public Offre getOffreById(long id) throws ServiceException {
		Offre usrOfr = gnDao.getEntityById(Offre.class, id);
		return usrOfr;
	}

	public Collection<Offre> getOffres() throws ServiceException {
		Collection<Offre> listOffres = gnDao
				.getEntitys(Offre.class, "Offre");
		return listOffres;
	}

	@Override
	public Collection<Offre> getOffreByCritere(String strO)
			throws ServiceException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void removeOffre(Long id) throws ServiceException {
		// TODO Auto-generated method stub

	}

	@Override
	public Long ajoutOffre(Offre ofr) throws ServiceException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void modifieOffre(Offre ofr) throws ServiceException {
		// TODO Auto-generated method stub

	}

}
